package lanqiaobei;

public class dengchashulie {
public static void main(String[] args) {
	Long ansLong = f(20190324);
	System.out.println(ansLong%10000);
}

static Long f(int n) {
	if(n==1) {
		return 1L;
	}
	if(n==2) {
		return 1L;
	}
	if(n==3) {
		return 1L;
	}
	return f(n-1)+f(n-2)+f(n-3);
}
}
